package com.leapp.sk.viewdelegate.notify

import android.content.Context
import android.support.v4.content.ContextCompat
import android.support.v4.widget.SwipeRefreshLayout
import android.text.TextUtils
import com.example.mvp.delegate.BaseAppDelegate
import com.example.mvp.view.SKTopBar
import com.leapp.sk.R
import com.leapp.sk.ui.activity.notify.ClasaNotifyDetialActivity

/**
 * 班级通知详情视图托管类
 * @author  chaohaipeng  on 2018/8/2.
 */
class ClassNotifyDetialDelegate : BaseAppDelegate(){

    override fun initWidget() {
    }
    override fun initLayoutRes(): Int {
        return R.layout.activity_class_notify_detital
    }
    /**
     * 设置标题
     */
    fun setTitle(title:String?){
        val topBar= getView<SKTopBar>(R.id.jtb_acnd)
        if (!TextUtils.isEmpty(title)){
            topBar?.setTitle(title)
        }
        setEvent(topBar)
    }
    /**
     * 设置设置事件
     */
    private  fun setEvent(topBar: SKTopBar){
        topBar?.setEventInterface(object : SKTopBar.EventInterface{
            override fun leftOnClick() {
                getActivity<ClasaNotifyDetialActivity>().finish()
            }
            override fun rightOnClick() {
            }

        })
    }
}